import typescript from '@rollup/plugin-typescript'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
// import json from 'rollup-plugin-json'
// import nodePolyfills from 'rollup-plugin-node-polyfills'
// import { terser } from 'rollup-plugin-terser'

// const extensions = [
//     '.js',
//     '.ts',
//     '.tsx'
// ]

// console.log(pkg)

export default {
    input: 'src/index.ts',
    output: {
        format: 'iife',
        name: 'Reader',
        file: 'dist/reader.js',
        globals: {
            'axios': 'axios'
        }
    },
    plugins: [
        // example(),
        resolve({
            browser: true
        }),
        commonjs(),
        typescript({
            target: 'es3'
        })
    ],
    external: ['axios']
}
